class Solution(object):
    def maxArea(self, height):
        """
        :type height: List[int]
        :rtype: int
        """
        left = 0  # 左指针
        right = len(height) - 1  # 右指针
        max_water = 0  # 最大水量
        
        while left < right:
            # 计算当前容器的水量
            current_height = min(height[left], height[right])
            current_width = right - left
            current_water = current_height * current_width
            
            # 更新最大水量
            max_water = max(max_water, current_water)
            
            # 移动指针
            if height[left] < height[right]:
                left += 1
            else:
                right -= 1
                
        return max_water

# 测试代码
if __name__ == "__main__":
    solution = Solution()
    # 测试用例1
    test1 = [1,8,6,2,5,4,8,3,7]
    print(f"测试用例1 [1,8,6,2,5,4,8,3,7] 的结果: {solution.maxArea(test1)}")  # 预期输出: 49
    
    # 测试用例2
    test2 = [1,1]
    print(f"测试用例2 [1,1] 的结果: {solution.maxArea(test2)}")  # 预期输出: 1 